*****************************************************************************
* Targeting of Chinese Tariffs & Mid-term Elections (County-level Analysis) * 
*****************************************************************************

use "tradewar_io_county.dta", clear

* Table A1: Summary Statistics of Key County-Level Variables

eststo clear
estpost summarize emp_chn_target_april emp_chn_target_june emp_chn_target_aug emp_chn_target_sept emp_chn_target_cum_june emp_chn_target_cum_aug emp_all_target_sept emp_us_protect_cum_june emp_us_protect_cum_aug emp_us_protect_cum_sept  emp_eu_target emp_can_target emp_mex_target  log_exp_nominal log_exp_agri county_repshare_house1416 swing_dist_20_1416 delta_repshare1618 delta_repshare1416   
esttab using "TableA1.tex", cells("count mean(fmt(2)) sd(fmt(2)) min(fmt(2)) max(fmt(2))") nomtitle nonumber label replace b(3)

* Table A3: Retaliatory Tariffs and Mid-term Election, All Economic Players Combined

eststo clear 

gen emp_all_target = emp_chn_target_april
eststo: xi: regress delta_repshare1618 emp_all_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: regress delta_repshare1618 emp_all_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416 i.state_fips [aw= voting_age_pop], robust

replace emp_all_target = emp_all_target_june
gen emp_us_target = emp_us_protect_cum_june 
eststo: xi: regress delta_repshare1618 emp_all_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: regress delta_repshare1618 emp_all_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416 i.state_fips [aw= voting_age_pop], robust

replace emp_all_target = emp_all_target_aug
replace emp_us_target = emp_us_protect_cum_aug 
eststo: xi: regress delta_repshare1618 emp_all_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: regress delta_repshare1618 emp_all_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416 i.state_fips [aw= voting_age_pop], robust

replace emp_all_target = emp_all_target_sept
replace emp_us_target = emp_us_protect_cum_sept 
eststo: xi: regress delta_repshare1618 emp_all_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: regress delta_repshare1618 emp_all_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416 i.state_fips [aw= voting_age_pop], robust

label var emp_all_target "\%, Targeted by Retaliatory Tariffs"
label var emp_us_target "\%, Protected by US Tariffs"

esttab using "TableA3.tex", label keep(emp_all_target emp_us_target avg_wkly_wage_pct_chg1718 delta_repshare1416  ) order(emp_all_target emp_us_target avg_wkly_wage_pct_chg1718 delta_repshare1416) indicate("State FE = *state_fip*"  "Demographic Controls = female_share2016" )  addnotes("Robust standard errors in parentheses." "\textit{+p < 0.10, * p < 0.05, ** p < 0.01}")  nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("China" "" "EU/Mexico/Canada" "" "All Combined" "")

* Table A5: Counties Targeted by Tariffs: Swing District with 10% of Overlap as a Threshold

eststo clear
eststo: xi: regress emp_chn_target_april county_repshare_house1416 swing_dist_10_1416 i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_april county_repshare_house1416 swing_dist_10_1416 repcounty_swing_10_1416 i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_june county_repshare_house1416 swing_dist_10_1416 i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_june county_repshare_house1416 swing_dist_10_1416 repcounty_swing_10_1416  i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_aug county_repshare_house1416 swing_dist_10_1416 i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_aug county_repshare_house1416 swing_dist_10_1416 repcounty_swing_10_1416 i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_sept county_repshare_house1416 swing_dist_10_1416 i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_sept county_repshare_house1416 swing_dist_10_1416 repcounty_swing_10_1416 i.state_fips [aw=voting_age_pop], robust
esttab using "TableA5.tex", label keep(county_repshare_house1416 swing_dist_10_1416 repcounty_swing_10_1416)  addnotes("Robust standard errors in parentheses." "\textit{+p < 0.10, * p < 0.05, ** p < 0.01}" "Observations are weighted by counties' total voting age population in 2016.") nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "" "" "" "" "") 

* Table A6: Counties Targeted by Tariffs: Swing District with 30% of Overlap as a Threshold

eststo clear
eststo: xi: regress emp_chn_target_april county_repshare_house1416 swing_dist_30_1416 i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_april county_repshare_house1416 swing_dist_30_1416 repcounty_swing_30_1416 i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_june county_repshare_house1416 swing_dist_30_1416 i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_june county_repshare_house1416 swing_dist_30_1416 repcounty_swing_30_1416  i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_aug county_repshare_house1416 swing_dist_30_1416 i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_aug county_repshare_house1416 swing_dist_30_1416 repcounty_swing_30_1416 i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_sept county_repshare_house1416 swing_dist_30_1416 i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_sept county_repshare_house1416 swing_dist_30_1416 repcounty_swing_30_1416 i.state_fips [aw=voting_age_pop], robust
esttab using "TableA6.tex", label keep(county_repshare_house1416 swing_dist_30_1416 repcounty_swing_30_1416)  addnotes("Robust standard errors in parentheses." "\textit{+p < 0.10, * p < 0.05, ** p < 0.01}" "Observations are weighted by counties' total voting age population in 2016.") nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "" "" "" "" "") 

* Table A7: Counties Targeted by Tariffs: Swing District (Cook Rating, 20% of Overlap)

eststo clear
eststo: xi: regress emp_chn_target_april county_repshare_house1416 cook_v_dist_20 i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_april county_repshare_house1416 cook_v_dist_20 repcounty_v_cook_dist_20 i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_june county_repshare_house1416 cook_v_dist_20 i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_june county_repshare_house1416 cook_v_dist_20 repcounty_v_cook_dist_20  i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_aug county_repshare_house1416 cook_v_dist_20 i.state_fips  [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_aug county_repshare_house1416 cook_v_dist_20 repcounty_v_cook_dist_20  i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_sept county_repshare_house1416 cook_v_dist_20 i.state_fips  [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_sept county_repshare_house1416 cook_v_dist_20 repcounty_v_cook_dist_20 i.state_fips [aw=voting_age_pop], robust
esttab using "TableA7.tex", label keep(county_repshare_house1416 cook_v_dist_20 repcounty_v_cook_dist_20)  addnotes("Robust standard errors in parentheses." "\textit{+p < 0.10, * p < 0.05, ** p < 0.01}" "Observations are weighted by counties' total voting age population in 2016.") nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "" "" "" "" "")

* Table A8: Counties Targeted by Tariffs: Swing District (Cook Rating, 30% of Overlap)

eststo clear
eststo: xi: regress emp_chn_target_april county_repshare_house1416 cook_v_dist_30 i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_april county_repshare_house1416 cook_v_dist_30 repcounty_v_cook_dist_30 i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_june county_repshare_house1416 cook_v_dist_30 i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_june county_repshare_house1416 cook_v_dist_30 repcounty_v_cook_dist_30  i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_aug county_repshare_house1416 cook_v_dist_30 i.state_fips  [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_aug county_repshare_house1416 cook_v_dist_30 repcounty_v_cook_dist_30  i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_sept county_repshare_house1416 cook_v_dist_30 i.state_fips  [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_sept county_repshare_house1416 cook_v_dist_30 repcounty_v_cook_dist_30 i.state_fips [aw=voting_age_pop], robust
esttab using "TableA8.tex", label keep(county_repshare_house1416 cook_v_dist_30 repcounty_v_cook_dist_30)  addnotes("Robust standard errors in parentheses." "\textit{+p < 0.10, * p < 0.05, ** p < 0.01}" "Observations are weighted by counties' total voting age population in 2016.") nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "" "" "" "" "")

* Table A9: Counties Targeted by Retaliatory Tariffs (Export Value Controlled)

eststo clear
eststo: xi: regress emp_chn_target_april county_repshare_house1416 swing_dist_20_1416 log_exp_nominal i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_april county_repshare_house1416 swing_dist_20_1416 repcounty_swing_20_1416 log_exp_nominal i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_june county_repshare_house1416 swing_dist_20_1416 log_exp_nominal i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_june county_repshare_house1416 swing_dist_20_1416 repcounty_swing_20_1416  log_exp_nominal i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_aug county_repshare_house1416 swing_dist_20_1416 log_exp_nominal i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_aug county_repshare_house1416 swing_dist_20_1416 repcounty_swing_20_1416 log_exp_nominal i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_sept county_repshare_house1416 swing_dist_20_1416 log_exp_nominal i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_sept county_repshare_house1416 swing_dist_20_1416 repcounty_swing_20_1416 log_exp_nominal i.state_fips [aw=voting_age_pop], robust
esttab using "TableA9.tex", label keep(county_repshare_house1416 swing_dist_20_1416 repcounty_swing_20_1416 log_exp_nominal) order(county_repshare_house1416 swing_dist_20_1416 repcounty_swing_20_1416 log_exp_nominal)  addnotes("Robust standard errors in parentheses." "\textit{+p < 0.10, * p < 0.05, ** p < 0.01}" "Observations are weighted by counties' total voting age population in 2016.") nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "" "" "" "" "")

* Table A10: Counties Targeted by Retaliatory Tariffs (Agricultural Export Value Controlled)

eststo clear
eststo: xi: regress emp_chn_target_april county_repshare_house1416 swing_dist_20_1416 log_exp_agri i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_april county_repshare_house1416 swing_dist_20_1416 repcounty_swing_20_1416 log_exp_agri i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_june county_repshare_house1416 swing_dist_20_1416 log_exp_agri i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_june county_repshare_house1416 swing_dist_20_1416 repcounty_swing_20_1416  log_exp_agri i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_aug county_repshare_house1416 swing_dist_20_1416 log_exp_agri i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_aug county_repshare_house1416 swing_dist_20_1416 repcounty_swing_20_1416 log_exp_agri i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_sept county_repshare_house1416 swing_dist_20_1416 log_exp_agri i.state_fips [aw=voting_age_pop], robust
eststo: xi: regress emp_chn_target_sept county_repshare_house1416 swing_dist_20_1416 repcounty_swing_20_1416 log_exp_agri i.state_fips [aw=voting_age_pop], robust
esttab using "TableA10.tex", label keep(county_repshare_house1416 swing_dist_20_1416 repcounty_swing_20_1416 log_exp_agri) order(county_repshare_house1416 swing_dist_20_1416 repcounty_swing_20_1416 log_exp_agri) addnotes("Robust standard errors in parentheses." "\textit{+p < 0.10, * p < 0.05, ** p < 0.01}" "Observations are weighted by counties' total voting age population in 2016.") nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "" "" "" "" "")

* Table A11: Tariffs and Mid-term Election: Excluding Uncontested Elections

eststo clear
gen emp_chn_target = emp_chn_target_april
eststo: xi: regress delta_repshare1618_cts emp_chn_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: regress delta_repshare1618_cts emp_chn_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416_cts  i.state_fips [aw= voting_age_pop], robust

replace emp_chn_target = emp_chn_target_cum_june 
eststo: xi: regress delta_repshare1618_cts emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: regress delta_repshare1618_cts emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416_cts  i.state_fips [aw= voting_age_pop], robust

replace emp_chn_target = emp_chn_target_cum_aug 
replace emp_us_target = emp_us_protect_cum_aug 
eststo: xi: regress delta_repshare1618_cts emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: regress delta_repshare1618_cts emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416_cts  i.state_fips [aw= voting_age_pop], robust

replace emp_chn_target = emp_chn_target_cum_sept 
replace emp_us_target = emp_us_protect_cum_sept 
eststo: xi: regress delta_repshare1618_cts emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: regress delta_repshare1618_cts emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416_cts  i.state_fips [aw= voting_age_pop], robust

label var emp_chn_target "\%, Targeted by Chinese Tariffs"
label var emp_us_target "\%, Protected by US Tariffs"

esttab using "TableA11.tex", label keep(emp_chn_target emp_us_target avg_wkly_wage_pct_chg1718 delta_repshare1416_cts) order(emp_chn_target emp_us_target avg_wkly_wage_pct_chg1718 delta_repshare1416_cts ) indicate("State FE = *state_fip*"  "Demographic Controls = female_share2016" )  addnotes("Robust standard errors in parentheses." "\textit{+p < 0.10, * p < 0.05, ** p < 0.01}" "Observations are weighted by counties' total voting age population in 2016.")  nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "" "" "" "" "")

* Table A12: Tariffs and Mid-term Election: No Weighting

eststo clear
replace emp_chn_target = emp_chn_target_april
eststo: xi: regress delta_repshare1618 emp_chn_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips, robust
eststo: xi: regress delta_repshare1618 emp_chn_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416  i.state_fips, robust

replace emp_chn_target = emp_chn_target_cum_june 
replace emp_us_target = emp_us_protect_cum_june 
eststo: xi: regress delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips, robust
eststo: xi: regress delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416  i.state_fips, robust

replace emp_chn_target = emp_chn_target_cum_aug 
replace emp_us_target = emp_us_protect_cum_aug 
eststo: xi: regress delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips, robust
eststo: xi: regress delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416  i.state_fips, robust

replace emp_chn_target = emp_chn_target_cum_sept
replace emp_us_target = emp_us_protect_cum_sept 
eststo: xi: regress delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips, robust
eststo: xi: regress delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416  i.state_fips, robust

esttab using "TableA12.tex", label keep(emp_chn_target emp_us_target delta_repshare1416 avg_wkly_wage_pct_chg1718 ) order(emp_chn_target emp_us_target avg_wkly_wage_pct_chg1718 delta_repshare1416 ) indicate("State FE = *state_fip*"  "Demographic Controls = female_share2016" )  addnotes("Robust standard errors in parentheses." "\textit{+p < 0.10, * p < 0.05, ** p < 0.01}")  nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "" "" "" "" "")

* Table A13: Tariffs and Mid-term Election: Weighting by Total County-Level Votes of 2016

eststo clear
replace emp_chn_target = emp_chn_target_april
eststo: xi: regress delta_repshare1618 emp_chn_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= county_totalvotes_house2016], robust
eststo: xi: regress delta_repshare1618 emp_chn_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416  i.state_fips [aw= county_totalvotes_house2016], robust

replace emp_chn_target = emp_chn_target_cum_june 
replace emp_us_target = emp_us_protect_cum_june 
eststo: xi: regress delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= county_totalvotes_house2016], robust
eststo: xi: regress delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416  i.state_fips [aw= county_totalvotes_house2016], robust

replace emp_chn_target = emp_chn_target_cum_aug 
replace emp_us_target = emp_us_protect_cum_aug 
eststo: xi: regress delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= county_totalvotes_house2016], robust
eststo: xi: regress delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416  i.state_fips [aw= county_totalvotes_house2016], robust

replace emp_chn_target = emp_chn_target_cum_sept 
replace emp_us_target = emp_us_protect_cum_sept 
eststo: xi: regress delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= county_totalvotes_house2016], robust
eststo: xi: regress delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416  i.state_fips [aw= county_totalvotes_house2016], robust

esttab using "TableA13.tex", label keep(emp_chn_target emp_us_target delta_repshare1416 avg_wkly_wage_pct_chg1718 ) order(emp_chn_target emp_us_target avg_wkly_wage_pct_chg1718 delta_repshare1416 ) indicate("State FE = *state_fip*"  "Demographic Controls = female_share2016" )  addnotes("Robust standard errors in parentheses." "\textit{+p < 0.10, * p < 0.05, ** p < 0.01}" "Observations are weighted by counties' total votes in 2016.")  nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "" "" "" "" "")

* Table A14: Vulnerable Districts and Change in Republican Support

replace emp_us_target = emp_us_protect_cum_june 

eststo clear

replace emp_chn_target = emp_chn_target_april
eststo: xi: regress delta_repshare1618 emp_chn_target swing_dist_20_1416 female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: regress delta_repshare1618 emp_chn_target swing_dist_20_1416 female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416  i.state_fips [aw= voting_age_pop], robust

replace emp_chn_target = emp_chn_target_cum_june 
eststo: xi: regress delta_repshare1618 emp_chn_target swing_dist_20_1416 emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: regress delta_repshare1618 emp_chn_target swing_dist_20_1416 emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416  i.state_fips [aw= voting_age_pop], robust

replace emp_chn_target = emp_chn_target_cum_aug 
replace emp_us_target = emp_us_protect_cum_aug 
eststo: xi: regress delta_repshare1618 emp_chn_target swing_dist_20_1416 emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: regress delta_repshare1618 emp_chn_target swing_dist_20_1416 emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416  i.state_fips [aw= voting_age_pop], robust

replace emp_chn_target = emp_chn_target_cum_sept 
replace emp_us_target = emp_us_protect_cum_sept 
eststo: xi: regress delta_repshare1618 emp_chn_target swing_dist_20_1416 emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: regress delta_repshare1618 emp_chn_target swing_dist_20_1416 emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416  i.state_fips [aw= voting_age_pop], robust

esttab using "TableA14.tex", label keep(emp_chn_target emp_us_target swing_dist_20_1416 avg_wkly_wage_pct_chg1718 delta_repshare1416  ) order(emp_chn_target emp_us_target avg_wkly_wage_pct_chg1718 delta_repshare1416 ) indicate("State FE = *state_fip*"  "Demographic Controls = female_share2016" )  addnotes("Robust standard errors in parentheses." "\textit{+p < 0.10, * p < 0.05, ** p < 0.01}" "Observations are weighted by counties' total voting age population in 2016.")  nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "" "" "" "" "")

* Table A18: Tariffs on Agricultural vs. Non-agricultural Products and Mid-term Election

gen emp_agri_chn_target = emp_chn_agri_april
label var emp_agri_chn_target "\% Targeted by Tariffs on Agriculture"

gen emp_non_agri_chn_target = emp_chn_nonag_april
label var emp_non_agri_chn_target "\% Targeted by Tariffs on Non-agriculture"
 
eststo clear
eststo: xi: regress delta_repshare1618 emp_agri_chn_target emp_non_agri_chn_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: regress delta_repshare1618 emp_agri_chn_target emp_non_agri_chn_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416  i.state_fips [aw= voting_age_pop], robust

replace emp_agri_chn_target = emp_chn_agri_june
replace emp_non_agri_chn_target = emp_chn_nonag_june
replace emp_us_target = emp_us_protect_cum_june

eststo: xi: regress delta_repshare1618 emp_agri_chn_target emp_non_agri_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: regress delta_repshare1618 emp_agri_chn_target emp_non_agri_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416  i.state_fips [aw= voting_age_pop], robust

replace emp_agri_chn_target = emp_chn_agri_aug
replace emp_non_agri_chn_target = emp_chn_nonag_aug
replace emp_us_target = emp_us_protect_cum_aug

eststo: xi: regress delta_repshare1618 emp_agri_chn_target emp_non_agri_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: regress delta_repshare1618 emp_agri_chn_target emp_non_agri_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416  i.state_fips [aw= voting_age_pop], robust

replace emp_agri_chn_target = emp_chn_agri_sept
replace emp_non_agri_chn_target = emp_chn_nonag_sept
replace emp_us_target = emp_us_protect_cum_sept

eststo: xi: regress delta_repshare1618 emp_agri_chn_target emp_non_agri_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: regress delta_repshare1618 emp_agri_chn_target emp_non_agri_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416  i.state_fips [aw= voting_age_pop], robust

esttab using "TableA18.tex", label keep(emp_agri_chn_target emp_non_agri_chn_target emp_us_target delta_repshare1416 avg_wkly_wage_pct_chg1718 ) order(emp_agri_chn_target emp_non_agri_chn_target emp_us_target avg_wkly_wage_pct_chg1718 delta_repshare1416 ) indicate("State FE = *state_fip*"  "Demographic Controls = female_share2016" )  addnotes("Robust standard errors in parentheses." "\textit{+p < 0.10, * p < 0.05, ** p < 0.01}" "Observations are weighted by counties' total voting age population in 2016.")  nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "" "" "" "" "")

*****************************************************************************
* Targeting of Chinese Tariffs & Mid-term Elections (Czone-level Analysis) * 
*****************************************************************************

use "tradewar_io_czone.dta", clear

* Table A15: Retaliatory Tariffs and Mid-term Election at the Commuting-Zone Levels

gen emp_chn_target = emp_chn_target_april
label var emp_chn_target "\%, Targeted by Chinese Tariffs"

eststo clear
eststo: xi: regress delta_repshare1618 emp_chn_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group_share_1_9 age_group_share_2_9 age_group_share_3_9 age_group_share_4_9 age_group_share_5_9 age_group_share_6_9 age_group_share_7_9 age_group_share_8_9 avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: regress delta_repshare1618 emp_chn_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group_share_1_9 age_group_share_2_9 age_group_share_3_9 age_group_share_4_9 age_group_share_5_9 age_group_share_6_9 age_group_share_7_9 age_group_share_8_9 avg_wkly_wage_pct_chg1718  delta_repshare1416  i.state_fips [aw= voting_age_pop], robust

replace emp_chn_target = emp_chn_target_cum_june 

gen emp_us_target = emp_us_protect_cum_june 
label var emp_us_target "\%, Protected by US Tariffs"

eststo: xi: regress delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group_share_1_9 age_group_share_2_9 age_group_share_3_9 age_group_share_4_9 age_group_share_5_9 age_group_share_6_9 age_group_share_7_9 age_group_share_8_9 avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: regress delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group_share_1_9 age_group_share_2_9 age_group_share_3_9 age_group_share_4_9 age_group_share_5_9 age_group_share_6_9 age_group_share_7_9 age_group_share_8_9 avg_wkly_wage_pct_chg1718  delta_repshare1416  i.state_fips [aw= voting_age_pop], robust

replace emp_chn_target = emp_chn_target_cum_aug 
replace emp_us_target = emp_us_protect_cum_aug

eststo: xi: regress delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group_share_1_9 age_group_share_2_9 age_group_share_3_9 age_group_share_4_9 age_group_share_5_9 age_group_share_6_9 age_group_share_7_9 age_group_share_8_9 avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: regress delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group_share_1_9 age_group_share_2_9 age_group_share_3_9 age_group_share_4_9 age_group_share_5_9 age_group_share_6_9 age_group_share_7_9 age_group_share_8_9 avg_wkly_wage_pct_chg1718  delta_repshare1416  i.state_fips [aw= voting_age_pop], robust

replace emp_chn_target = emp_chn_target_cum_sept 
replace emp_us_target = emp_us_protect_cum_sept

eststo: xi: regress delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group_share_1_9 age_group_share_2_9 age_group_share_3_9 age_group_share_4_9 age_group_share_5_9 age_group_share_6_9 age_group_share_7_9 age_group_share_8_9 avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: regress delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group_share_1_9 age_group_share_2_9 age_group_share_3_9 age_group_share_4_9 age_group_share_5_9 age_group_share_6_9 age_group_share_7_9 age_group_share_8_9 avg_wkly_wage_pct_chg1718  delta_repshare1416  i.state_fips [aw= voting_age_pop], robust

esttab using "TableA15.tex", label keep(emp_chn_target emp_us_target delta_repshare1416 avg_wkly_wage_pct_chg1718) order(emp_chn_target emp_us_target delta_repshare1214  avg_wkly_wage_pct_chg1718 delta_repshare1416) indicate("State FE = *state_fip*"  "Demographic Controls = female_share2016" )  addnotes("Robust standard errors in parentheses." "\textit{+p < 0.10, * p < 0.05, ** p < 0.01}" "Observations are weighted by commuting zones' total voting age population in 2016.")  nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("April" "" "June" "" "August" "" "September" "")


*********************************************************
* Targeting of Chinese Tariffs (Product-level Analysis) * 
*********************************************************

* Table A4: Product-Level Analysis of All Tariffs

use "tradewar_io_product.dta", clear

gen import_volumne = log_us_export_chn
gen import_share = chn_import_share_us
label var import_volumne "Log(Imports Volume from the US)"
label var import_share "Imports Dependence on the US"

eststo clear
eststo: dprobit china_tgt gop_concentration import_volumne import_share, robust

replace import_volumne = log_us_export_eu
replace import_share = eu_import_share_us
eststo: dprobit eu_tgt gop_concentration import_volumne import_share, robust

replace import_volumne = log_us_export_can
replace import_share = can_import_share_us
eststo: dprobit canada_tgt gop_concentration import_volumne import_share, robust

replace import_volumne = log_us_export_mex
replace import_share = mex_import_share_us
eststo: dprobit mexico_tgt gop_concentration import_volumne import_share, robust

esttab using "TableA4.tex", label keep(gop_concentration import_volumne import_share) nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress margin nogaps nodepvars mtitles("" "" "" "") 

********************************************
* Campaign Communications on the Trade War * 
********************************************

use "tradewar_io_campaign.dta", clear

* Table A16: Retaliatory Tariffs and Campaign Communications Regarding the Trade War: Trade and China

gen target = emp_chn_target_april 
label var target "\%, Targeted by Tariffs"
gen dem_target = dem_emp_chn_target_april
label var dem_target "\%, Targeted by Tariffs * Democratic"

eststo clear
eststo: regress china_prop democrat target, robust
eststo: regress china_prop democrat target dem_target, robust

replace target = emp_chn_target_june
replace dem_target = dem_emp_chn_target_june

eststo: regress china_prop democrat target, robust
eststo: regress china_prop democrat target dem_target, robust

replace target = emp_chn_target_aug
replace dem_target = dem_emp_chn_target_aug

eststo: regress china_prop democrat target, robust
eststo: regress china_prop democrat target dem_target, robust

replace target = emp_chn_target_sept
replace dem_target = dem_emp_chn_target_sept

eststo: regress china_prop democrat target, robust
eststo: regress china_prop democrat target dem_target, robust

esttab using "TableA16.tex", label keep(democrat target dem_target) order(democrat target dem_target) addnotes("Robust standard errors in parentheses." "\textit{+p < 0.10, * p < 0.05, ** p < 0.01}")  nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "" "" "" "" "")

* Table A17: Retaliatory Tariffs and Campaign Communications Regarding the Trade War: Tariff and China

replace target = emp_chn_target_april 
replace dem_target = dem_emp_chn_target_april

eststo clear
eststo: regress tariff_prop democrat target, robust
eststo: regress tariff_prop democrat target dem_target, robust

replace target = emp_chn_target_june
replace dem_target = dem_emp_chn_target_june

eststo: regress tariff_prop democrat target, robust
eststo: regress tariff_prop democrat target dem_target, robust

replace target = emp_chn_target_aug
replace dem_target = dem_emp_chn_target_aug

eststo: regress tariff_prop democrat target, robust
eststo: regress tariff_prop democrat target dem_target, robust

replace target = emp_chn_target_sept
replace dem_target = dem_emp_chn_target_sept

eststo: regress tariff_prop democrat target, robust
eststo: regress tariff_prop democrat target dem_target, robust

esttab using "TableA17.tex", label keep(democrat target dem_target) order(democrat target dem_target) addnotes("Robust standard errors in parentheses." "\textit{+p < 0.10, * p < 0.05, ** p < 0.01}")  nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "" "" "" "" "")

***********************************
* Public Opinion on the Trade War * 
***********************************

* Table A2: Summary Statistics of the Survey Data

use "tradewar_io_survey.dta", clear

eststo clear
areg demrole industry_chn_target cty_chn_target cty_us_protect i.education i.race i.emp_status age usnative female usnative naicsmissing, absorb(state) cl(state)
sum industry_chn_target cty_chn_target cty_us_protect Dchinaonus Dchinaonarea Dchinaonfamily trumprole goprole demrole education female i.race i.emp_status age usnative if e(sample)

***************************
* Counterfactual Analysis * 
***************************

* Table A19: Counterfactual Outcomes of Selected Congressional Districts

use "tradewar_io_county_cd", clear

gen counterfactual_v1 = cocd_gopshare_2016 + delta_gopshare1618 + (emp_chn_target_cum_sept*.1316697)
gen counterfactual_v2 = cocd_gopshare_2016 + delta_gopshare1618 + (emp_chn_target_cum_sept*.1316697) - (emp_us_protect_cum_sept* .0696562)
replace counterfactual_v1 = 100 if counterfactual_v1 > 100 & counterfactual_v1 != .
replace counterfactual_v2 = 100 if counterfactual_v2 > 100 & counterfactual_v2 != .

gen counter_v1_gopvotes_house2018 = (cocd_gopvotes_2018+cocd_demvotes_2018)*counterfactual_v1/100
gen counter_v1_demvotes_house2018 = (cocd_gopvotes_2018+cocd_demvotes_2018)*(100-counterfactual_v1)/100

gen counter_v2_gopvotes_house2018 = (cocd_gopvotes_2018+cocd_demvotes_2018)*counterfactual_v2/100
gen counter_v2_demvotes_house2018 = (cocd_gopvotes_2018+cocd_demvotes_2018)*(100-counterfactual_v2)/100

bysort state_fips cd: egen counter_v1_gopvotes_dist = total(counter_v1_gopvotes_house2018)
bysort state_fips cd: egen counter_v1_demvotes_dist = total(counter_v1_demvotes_house2018)

bysort state_fips cd: egen counter_v2_gopvotes_dist = total(counter_v2_gopvotes_house2018)
bysort state_fips cd: egen counter_v2_demvotes_dist = total(counter_v2_demvotes_house2018)

bysort state_fips cd: egen gopvotes_district = total(cocd_gopvotes_2018)
bysort state_fips cd: egen demvotes_district = total(cocd_demvotes_2018)

duplicates drop state_fips cd, force

drop if state_fips == "42" | state_fips == "02" | state_fips == "23" /* dropping states where district boundaries were redistricted */

gen counter_v1_rep_win = 0
replace counter_v1_rep_win = 1 if counter_v1_gopvotes_dist > counter_v1_demvotes_dist

gen counter_v2_rep_win = 0 
replace counter_v2_rep_win = 1 if  counter_v2_gopvotes_dist > counter_v2_demvotes_dist

gen counter_v1_rep_share = counter_v1_gopvotes_dist/(counter_v1_gopvotes_dist+counter_v1_demvotes_dist)
gen counter_v2_rep_share = counter_v2_gopvotes_dist/(counter_v2_gopvotes_dist+counter_v2_demvotes_dist)

gen actual_rep_win = 0 
replace actual_rep_win = 1 if district_dem_vote2018 < district_gop_vote2018

gen district_gop_share = district_gop_vote2018/(district_gop_vote2018+district_dem_vote2018)

list state cd district_gop_share counter_v1_rep_share counter_v2_rep_share if counter_v1_rep_win == 1 & actual_rep_win == 0

*************************************
* Figures A3-A4 Simulation Approach * 
*************************************

use "tradewar_io_product.dta", clear

bysort china_tgt: egen total_trade_chn = total(us_export_chn)
bysort eu_tgt: egen total_trade_eu = total(us_export_eu)
bysort canada_tgt: egen total_trade_can = total(us_export_can)
bysort mexico_tgt: egen total_trade_mex = total(us_export_mex)

/* total trade volume of targeted: 42791579648 (China); 11340051456 (Canada); 4238207744 (EU); 6309830656 (Mexico) */

* China

gen china_count = .

file open myfile using "simulation_china.txt", write replace

forvalues i = 1/10000 {

	replace china_count = .

	gen sortorder = runiform()
	sort sortorder

	gen id = _n 
	
	gen cum_sum = sum(us_export_chn)
	gen difference = abs(cum_sum - 42791579648)
	egen min_difference = min(difference)
	
	gen random_selection = 0
	
	gen select_id = id if min_difference == difference & difference < 42791579648*0.05
	egen select_id2 = max(select_id)
	
	replace random_selection = 1 if (id < select_id2 | id == select_id2) & select_id2 != .
	
	egen count_egen = count(random_selection) if random_selection == 1
	egen count_egen2 = max(count_egen)
	replace china_count = count_egen2 
	
	capture dprobit random_selection gop_concentration log_us_export_chn  chn_import_share_us 
	
	capture matrix b = get(_b) 
	capture scalar fz = (1/sqrt(2*_pi))*exp(-(S_E_xbar^2)/2) 
	capture matrix df = fz*b 

	if china_count != . {
	
	file write myfile %7.6f (df[1,1]) _tab %7.6f (df[1,3]) _n

	}
		
	drop sortorder random_selection id cum_sum difference min_difference select_id* count_egen*

}

file close _all

import delimited "simulation_china.txt", clear 

gen id = _n 
keep if id < 1001

count if v1 < .68047977
display r(N)/c(N)

count if v2 < .1064761
display r(N)/c(N)

twoway (histogram v1, fcolor(gs8) color(%30) lcolor(white) lwidth(vthin)) (kdensity v1, color(gs8) lpattern(dash)  xline(.68047977, lcolor(dknavy)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) bgcolor(white) ytitle(,size(large)) xtitle("Simulated effects of Republican concentration", size(large)) legend(off)), note(Top 0.9%, size(large) color(dknavy))
graph export "FigureA3-(a).pdf", as(pdf) name("Graph") replace

twoway (histogram v2, fcolor(gs8) color(%30) lcolor(white) lwidth(vthin)) (kdensity v2, color(gs8) lpattern(dash)  xline(.1064761, lcolor(dknavy)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) bgcolor(white) ytitle(,size(large)) xtitle("Simulated effects of the US imports share", size(large)) legend(off)), note(Top 0.4%, size(large) color(dknavy))
graph export "FigureA4-(a).pdf", as(pdf) name("Graph") replace

* EU
 
use "tradewar_io_product.dta", clear

gen eu_count = .

file open myfile using "simulation_eu.txt", write replace

forvalues i = 1/10000 {

	replace eu_count = .

	gen sortorder = runiform()
	sort sortorder

	gen id = _n 
	
	gen cum_sum = sum(us_export_eu)
	gen difference = abs(cum_sum - 4238207744)
	egen min_difference = min(difference)
	
	gen random_selection = 0
	
	gen select_id = id if min_difference == difference & difference < 4238207744*0.05
	egen select_id2 = max(select_id)
	
	replace random_selection = 1 if (id < select_id2 | id == select_id2) & select_id2 != .
	
	egen count_egen = count(random_selection) if random_selection == 1
	egen count_egen2 = max(count_egen)
	replace eu_count = count_egen2 
	
	capture dprobit random_selection gop_concentration log_us_export_eu  eu_import_share_us 
	
	capture matrix b = get(_b) 
	capture scalar fz = (1/sqrt(2*_pi))*exp(-(S_E_xbar^2)/2) 
	capture matrix df = fz*b 
	
	if eu_count != . {
	
	file write myfile %7.6f (df[1,1]) _tab %7.6f (df[1,3]) _n

	}
	
	drop sortorder random_selection id cum_sum difference min_difference select_id* count_egen*
	
}
file close _all

import delimited "simulation_eu.txt", clear 

gen id = _n 
keep if id < 1001

count if v1 < .0119053
display r(N)/c(N)

count if v2 < -.0360975
display r(N)/c(N)

twoway (histogram v1, fcolor(gs8) color(%30) lcolor(white) lwidth(vthin)) (kdensity v1, color(gs8) lpattern(dash)  xline(.0119053, lcolor(dknavy)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) bgcolor(white) ytitle(,size(large)) xtitle("Simulated effects of Republican concentration", size(large)) legend(off)), note(Top 37.4%, size(large) color(dknavy))
graph export "FigureA3-(b).pdf", as(pdf) name("Graph") replace

twoway (histogram v2, fcolor(gs8) color(%30) lcolor(white) lwidth(vthin)) (kdensity v2, color(gs8) lpattern(dash)  xline(-.0360975, lcolor(dknavy)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) bgcolor(white) ytitle(,size(large)) xtitle("Simulated effects of the US imports share", size(large)) legend(off)), note(Top 99.7%, size(large) color(dknavy))
graph export "FigureA4-(b).pdf", as(pdf) name("Graph") replace

* Canada

use "tradewar_io_product.dta", clear

gen canada_count = .

file open myfile using "simulation_canada.txt", write replace

forvalues i = 1/10000 {

	gen sortorder = runiform()
	sort sortorder

	gen id = _n 
	
	gen cum_sum = sum(us_export_can)
	gen difference = abs(cum_sum - 11340051456)
	egen min_difference = min(difference)
	
	gen random_selection = 0
	
	gen select_id = id if min_difference == difference & difference < 11340051456*0.05
	egen select_id2 = max(select_id)
	
	replace random_selection = 1 if (id < select_id2 | id == select_id2) & select_id2 != .
	
	egen count_egen = count(random_selection) if random_selection == 1
	egen count_egen2 = max(count_egen)
	replace canada_count = count_egen2 
	
	capture dprobit random_selection gop_concentration log_us_export_can  can_import_share_us 
	
	capture matrix b = get(_b) 
	capture scalar fz = (1/sqrt(2*_pi))*exp(-(S_E_xbar^2)/2) 
	capture matrix df = fz*b 

	if canada_count != . {
	
	file write myfile %7.6f (df[1,1]) _tab %7.6f (df[1,3]) _n

	}
	
	drop sortorder random_selection id cum_sum difference min_difference select_id* count_egen*

}

file close _all

import delimited "simulation_canada.txt", clear 

gen id = _n 
keep if id < 1001

count if v1 < -.2220253
display r(N)/c(N)

count if v2 < .0056043
display r(N)/c(N)

twoway (histogram v1, fcolor(gs8) color(%30) lcolor(white) lwidth(vthin)) (kdensity v1, color(gs8) lpattern(dash)  xline(-.2220253, lcolor(dknavy)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) bgcolor(white) ytitle(,size(large)) xtitle("Simulated effects of Republican concentration", size(large))  legend(off)), note(Top 90.0%, size(large) color(dknavy))
graph export "FigureA3-(c).pdf", as(pdf) name("Graph") replace

twoway (histogram v2, fcolor(gs8) color(%30) lcolor(white) lwidth(vthin)) (kdensity v2, color(gs8) lpattern(dash)  xline(.0056043, lcolor(dknavy)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) bgcolor(white) ytitle(,size(large)) xtitle("Simulated effects of the US imports share", size(large))  legend(off)), note(Top 26.0%, size(large) color(dknavy))
graph export "FigureA4-(c).pdf", as(pdf) name("Graph") replace

* Mexico 

use "tradewar_io_product.dta", clear

gen mexico_count = .

file open myfile using "simulation_mexico.txt", write replace

forvalues i = 1/10000 {

	gen sortorder = runiform()
	sort sortorder

	gen id = _n 
	
	gen cum_sum = sum(us_export_mex)
	gen difference = abs(cum_sum - 6309830656)
	egen min_difference = min(difference)
	
	gen random_selection = 0
	
	gen select_id = id if min_difference == difference & difference < 6309830656*0.05
	egen select_id2 = max(select_id)
	
	replace random_selection = 1 if (id < select_id2 | id == select_id2) & select_id2 != .
	
	egen count_egen = count(random_selection) if random_selection == 1
	egen count_egen2 = max(count_egen)
	replace mexico_count = count_egen2 
	
	capture dprobit random_selection gop_concentration log_us_export_mex  mex_import_share_us 
	
	capture matrix b = get(_b) 
	capture scalar fz = (1/sqrt(2*_pi))*exp(-(S_E_xbar^2)/2) 
	capture matrix df = fz*b 

	if mexico_count != . {
	
	file write myfile %7.6f (df[1,1]) _tab %7.6f (df[1,3]) _n

	}
	
	drop sortorder random_selection id cum_sum difference min_difference select_id* count_egen*

}

file close _all

import delimited "simulation_mexico.txt", clear 

gen id2 = _n 
keep if id2 < 1001

count if v1 < -.1295312
display r(N)/c(N)

count if v2 < .0104142
display r(N)/c(N)

twoway (histogram v1, fcolor(gs8) color(%30) lcolor(white) lwidth(vthin)) (kdensity v1, color(gs8) lpattern(dash)  xline(-.1295312, lcolor(dknavy)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) bgcolor(white) ytitle(,size(large)) xtitle("Simulated effects of Republican concentration", size(large))  legend(off)), note(Top 79.7%, size(large) color(dknavy))
graph export "FigureA3-(d).pdf", as(pdf) name("Graph") replace

twoway (histogram v2, fcolor(gs8) color(%30) lcolor(white) lwidth(vthin)) (kdensity v2, color(gs8) lpattern(dash)  xline(.0104142, lcolor(dknavy)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) bgcolor(white) ytitle(,size(large)) xtitle("Simulated effects of the US imports share", size(large))  legend(off)), note(Top 9.8%, size(large) color(dknavy))
graph export "FigureA4-(d).pdf", as(pdf) name("Graph") replace
